package com.lzw.breezeNovel.WebAdmin.config;


import com.lzw.breezeNovel.WebAdmin.interceptor.webAdminInterceptor;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.config
 * @date 2025/2/28
 * @description webMvc配置类
 */
@SuppressWarnings("all")
@Configuration
public class webConfig implements WebMvcConfigurer {

    @Autowired
    private webAdminInterceptor authenticationInterceptor;


    /**
     * 注册拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(@NotNull InterceptorRegistry registry) {
        registry.addInterceptor(this.authenticationInterceptor)
                .excludePathPatterns("/admin/login/**")
                .addPathPatterns("/admin/**");
    }

}
